/* 观察res.write的返回值 */

var http = require('http');

var fs = require('fs');

var server = http.createServer(function(req, res){
	if(req.url !== '/favicon.ico'){
		fs.readFile('./server.js', function(err, data){
			if(err)  console.log("读取文件错误");
			else{
				var flag = res.write(data);
				console.log(flag);
				res.end();
			}
		})
	}
}).listen(1337, 'localhost');